package com.fenger.controller;


import com.fenger.service.ReplyService;
import com.fenger.utils.DataGirdView;
import com.fenger.vo.ReplyVo;
import com.fenger.vo.TopicVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 方
 * @since 2019-04-29
 */
@Controller
public class ReplyController {
    private final String INDEX_PREFIX= "reply/";
    @Autowired
    ReplyService replyService;

    @ResponseBody
    @RequestMapping(INDEX_PREFIX+"loadReplyByTopicid")
    public DataGirdView loadReplyByTopicid(TopicVo topicVo){
        return this.replyService.queryReplyByTopicid(topicVo);

    }
 @ResponseBody
    @RequestMapping(INDEX_PREFIX+"addReply")
    public DataGirdView addReply(ReplyVo topicVo){
        return this.replyService.insertReply(topicVo);

    }

}

